let baseUrl = "https://mobile.yiban.cn"

const url = {
    checkUpdate: baseUrl + "/api/v1/version/checkupdate",
    postCertification: baseUrl + "/api/v3/home/launchad",
    checkCertification: baseUrl + "/api/v3/home/checkupdate",
}

function getCheckCertification() {
    return ajax(url.checkCertification);
}

function postCertification(){
    return ajax(url.postCertification);
}

function checkUpdate(){
    return ajax(url.checkUpdate);
}

const ajax = function(url,data){
    wx.request({
        url: url,
        data: data,
        header: {
            'content-type': 'application/json'
        },
        success: function (res) {
            return res.data;
        }
    })
}

module.exports = {
    getCheckCertification,
    checkUpdate,
    postCertification
}